﻿using AutoMapper;
using Medical.Domain;
using Medical.ReadApi.Dto;
using Medical.WriteApi.Dto;

namespace BaseData.ReadApi
{
    /// <summary>
    /// AutoMapper 映射配置类
    /// 负责定义领域模型与DTO（数据传输对象）之间的映射规则
    /// </summary>
    public class MappingProfile : Profile
    {
        /// <summary>
        /// 构造函数 - 配置AutoMapper映射规则
        /// </summary>
        public MappingProfile()
        {
            // RegistrationSlipTemplate ⇄ RegistrationSlipTemplateDto
            CreateMap<RegistrationSlipTemplate, RegistrationSlipTemplateDto>().ReverseMap();

            // OutpatientOrderTemplate ⇄ OutpatientOrderTemplateDto
            CreateMap<OutpatientOrderTemplate, OutpatientOrderTemplateDto>().ReverseMap();
            CreateMap<InpatientOrderTemplate, InpatientOrderTemplateDto>().ReverseMap();
            CreateMap<Department, DepartmentDto>().ReverseMap();
            CreateMap<Disease, DiseaseDto>().ReverseMap();
            CreateMap<Employee, EmployeeDto>().ReverseMap();
            CreateMap<Role, RoleDto>().ReverseMap();
            CreateMap<Permission, PermissionDto>().ReverseMap();
        }
    }
}